<script src="/javascripts/jquery.selectboxes.js" type="text/javascript"></script>
<script src="/javascripts/provinces.js" type="text/javascript"></script>
<script src="/javascripts/validation/jquery.validate.js" type="text/javascript"></script>
<script src="/javascripts/validation/validate_form_address.js" type="text/javascript"></script>

<% if @address && @address.province_id %>
  <div style="display:none;">
    <div id="province_id"><%=@address.province_id%></div>
    <div id="city_id"><%=@address.city_id%></div>
    <div id="region_id"><%=@address.region_id%></div>
  </div>
<% end %>

<p>
  <label for="address_province_id">所在地</label>
  省份
  <select id="address_province_id" name="address[province_id]" onchange="loadCity()" >
  </select>
  城市
  <select id="address_city_id" name="address[city_id]" onchange="loadRegion()"></select>
  地区
  <select id="address_region_id"  name="address[region_id]" onchange="loadCode()"></select>
</p>

<p>
  <label for="address_street">地址</label>
  <%=text_field :address,:street %>
  <span class="tips">* </span>
</p>
<p>
  <label for="address_post_code">邮编</label>
  <%= text_field :address,:post_code,:size=>5 %>
</p>

<p>
  <label for="address_tel">固定电话</label>
  <%=text_field :address,:long_distance_code,:size=>5 %>-<%= text_field :address,:tel,:size=>10 %>
  <span class="tips">固话和手机号码至少填一个</span>
</p>

<p>
  <label for="address_mobile">手机</label>
  <%=text_field :address,:mobile %>
  <span class="tips">为了能顺利送达,请核对清楚联系电话 </span>
</p>

<p>
  <label for="address_receiver">收件人</label>
  <%=text_field :address,:receiver,:size=>10 %>
  <span class="tips">* </span>
</p>

<p>
  <label for="address_timing">收货时间段</label>
  <% for i in 0..Address::TIMING.length-1 %>
    <%=radio_button("address", "timing",i)%><%=Address::TIMING[i][0]%>
  <%  end %>
</p>



